#ifndef INVENTORY_H
#define INVENTORY_H

class Item;

#include <vector>
#include <map>

class Inventory {
public:
	static const int maxSize = 52;
public:
	bool add(Item* item);
	
	Item* drop(size_t index);
	
	Item* item(size_t index) const;
	Item* itemBySymbol(char symbol) const;
	
	int totalWeight() const;
	
	void remove(size_t index);
	
	inline int size() const { return static_cast<int> ( m_items.size() ); }
	
	char itemSymbol(Item* item) const;
	
private:
	bool containSymbol(char sym) const;
	bool mapInsert(Item* item, char sym);
	void mapErase(Item* item);
private:
	std::vector<Item *> m_items;
	std::map<Item *, char> m_symbolMapping;
};

#endif